package parsers;

import model.*;
import dtos.*;

public class NutrienteParser {
	private static NutrienteParser instance = null;
	protected NutrienteParser() {
	}
	public static NutrienteParser getInstance() {
		if(instance == null) {
    	  instance = new NutrienteParser();
		}
		return instance;
	}
	   
	public Nutriente fromDTOToModelEager(NutrienteDTO nutrienteDTO){
		Nutriente nutriente= new Nutriente();
		nutriente.setId(nutrienteDTO.getId());
		nutriente.setNombre(nutrienteDTO.getNombre());
		return nutriente;
		
	}
	
	public NutrienteDTO fromModelToDTOEager(Nutriente nutriente){
		NutrienteDTO nutrienteDTO= new NutrienteDTO();
		nutrienteDTO.setId(nutriente.getId());
		nutrienteDTO.setNombre(nutriente.getNombre());
		return nutrienteDTO;
		
	}
}
